<?php
/*Problem Domain
To test the Session entity of TMS*/

include_once '../TrainingSession.php';

class SessionTest extends PHPUnit_Framework_TestCase
{
	public function testSession()
	{
		$sess1 = new TrainingSession("phpsession", "ketul", date("2015-02-08 11:14:15.638276"), TrainingSession::AVAILABLE);

		$this->assertEquals(null , $sess1->getId());
		$this->assertEquals('phpsession', $sess1->getSessionName());
		$this->assertEquals('ketul', $sess1->getTrainer());
		$this->assertEquals('2015-02-08', date('Y-m-d' , $sess1->getStartDateTime()));
		$this->assertEquals(TrainingSession::AVAILABLE , $sess1->getStatus());
		
		$sess1->setStatus(TrainingSession::POSTPONED);
		$sess1->setPostDateTime(date("2015-02-12 11:00:00"));
		$this->assertEquals(2 , $sess1->getStatus());
		$this->assertEquals('2015-02-12' , date('Y-m-d', $sess1->getPostDateTime()));
		$this->assertEquals('11:00:00' , date('h:i:s' , $sess1->getPostDateTime()));
	}
}
?>
